package com.wtf.dsp.admin.model.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * ClassName: NsAddDTO
 * Description:
 * date: 2023/7/7 17:55
 *
 * @author linhuanyou
 * @version 1.0
 */
@Data
@ToString
@ApiModel("命名空间新增请求类")
public class NsAddDTO {

    @ApiModelProperty(value = "命名空间")
    @Length(min = 0,max = 20,message = "请输入不超过20个字符")
    @Pattern(regexp = "^[-a-zA-Z0-9]+$",message = "请输入英文、数字、-的字符的命名空间")
    @NotBlank(message = "请输入命名空间")
    private String ns;

    @ApiModelProperty(value = "命名空间名称")
    @Length(min = 0,max = 50,message = "请输入不超过50个字符")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5-a-zA-Z0-9]+$",message = "请输入中文、英文、数字、-的字符的名称")
    @NotBlank(message = "请输入命名空间名称")
    private String name;

    @ApiModelProperty(value = "描述")
    @Length(min = 0,max = 100,message = "请输入不超过100个字符")
    private String description;
}
